namespace Peer.Web.Controls.Upload
{
    using System;
    using System.IO;
    using System.Web;
    public class WebbTextTrace
    {
        private static string m_logFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "TraceLog.ashx");

        public WebbTextTrace(string str_traceMsg)
        {
            StreamWriter writer = File.AppendText(Path.Combine(Path.GetDirectoryName(typeof(WebbTextTrace).Assembly.Location), "TraceLog.ashx"));
            writer.WriteLine(DateTime.Now.ToString() + "\t" + str_traceMsg);
            writer.Close();
            writer = null;
        }

        public static void TraceMsg(string str_traceMsg)
        {
            TraceMsg(str_traceMsg, m_logFilePath);
        }

        public static void TraceMsg(string str_traceMsg, string str_fileName)
        {
            StreamWriter writer = File.AppendText(str_fileName);
            writer.WriteLine(DateTime.Now.ToString() + "\t" + str_traceMsg);
            writer.Close();
            writer = null;
        }
    }
}

